package cn.lili.modules.store.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.store.entity.dos.StoreLogistics;
import cn.lili.modules.store.entity.params.StoreLogisticsParams;
import cn.lili.modules.store.entity.vos.StoreLogisticsVO;
import cn.lili.modules.store.fallback.StoreLogisticsFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: ftyy
 * @date: 2022-01-19 18:07
 * @description: 店铺-物流公司
 */
@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.SYSTEM_SERVICE, contextId = "storeLogistics", fallback = StoreLogisticsFallback.class)
public interface StoreLogisticsClient {

    /**
     * 获取当前店铺的物流公司列表
     *
     * @param id 店铺id
     * @return 物流公司列表
     */
    @GetMapping("/feign/member/storeLogistics/{id}")
    List<StoreLogisticsVO> getStoreLogistics(@PathVariable String id);


    /**
     * 获取当前店铺的物流公司列表
     *
     * @param logisticsId 物流公司设置id
     * @param storeId 店铺id
     * @return 物流公司列表
     */
    @GetMapping("/feign/member/storeLogistics/{logisticsId}/{storeId}")
    StoreLogistics getStoreLogistics(@PathVariable String logisticsId, @PathVariable String storeId);
    /**
     * 获取当前店铺已选择的物流公司列表
     *
     * @param storeId 店铺id
     * @return 物流公司列表
     */
    @GetMapping("/feign/member/storeLogistics/getStoreSelectedLogistics")
    List<StoreLogisticsVO> getStoreSelectedLogistics(@RequestParam String storeId);

    /**
     * 获取当前店铺已选择的物流公司名称列表
     *
     * @param storeId 店铺id
     * @return 物流公司列表
     */
    @GetMapping("/feign/member/storeLogistics/getStoreSelectedLogisticsName")
    List<String> getStoreSelectedLogisticsName(@RequestParam String storeId);

    /**
     * 添加店铺-物流公司
     *
     * @param logisticsId 物流公司设置id
     * @param storeId     店铺id
     * @return 店铺物流公司
     */
    @GetMapping("/feign/member/storeLogistics/add")
    StoreLogistics add(@RequestParam String logisticsId, @RequestParam String storeId);

    @DeleteMapping("/feign/member/storeLogistics/remove")
    boolean remove(@RequestBody StoreLogisticsParams storeLogisticsParams);
}
